<%--
  Created by IntelliJ IDEA.
  User: xiaoji
  Date: 2014/11/6
  Time: 16:09
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="spring" uri="/WEB-INF/lib/spring.tld"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
    <title><spring:message code='usercenter.index.title' /></title>
    <link href="${path}/style/acg/css/style.css" rel="stylesheet" type="text/css" />
    <script src="${path}/js/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<jsp:include page="../public/header.jsp">
    <jsp:param    name="usercenter"    value="true"    />
</jsp:include>
<jsp:include page="../usercenter/leftMenu.jsp"></jsp:include>

<div class="member_box">
    <div class="member_title"><spring:message code='usercenter.initindex.msg1' /><em><a href="${path}/taskList/taskList.html"><spring:message code='usercenter.initindex.msg2' /></a></em><em><a href="${path}/taskList/taskList.html"><spring:message code='usercenter.initindex.msg3' /></a></em><span><a href="${path}/taskList/taskList.html"><spring:message code='usercenter.initindex.msg4' /></a></span></div>
    <div class="member_eventlist">
        <ul>
            <c:forEach var="r" items="${rtasks}">
                <li class="clearfix">
                    <div class="event_img"><img src="${path}/${r.pic}" onerror="javascript:this.src='${path}/style/common/images/headimg.jpg'" width="170" height="104" onclick="window.location='${path}/taskdetail/index.html?taskId=${r.itemId}'" style="cursor: pointer"/></div>
                    <div class="event_con clearfix">
                        <a href="${path}/taskdetail/index.html?taskId=${r.itemId}"><h3>${r.title}</h3></a>
                        <div class="shuxing">
                            <c:if test="${r.lang!='zh_cn'}">
                                <span><em class="gj"></em><spring:message code='usercenter.initindex.msg5' /></span>
                            </c:if>
                            <c:if test="${r.lang=='zh_cn'}">
                                <span><em class="gj"></em><spring:message code='usercenter.initindex.msg6' /></span>
                            </c:if>
                            <c:if test="${r.progress==105105}">
                                <span><em class="zb"></em><spring:message code='usercenter.initindex.msg7' /></span>
                            </c:if>
                            <c:if test="${r.progress>105105 && r.progress<=105110}">
                                <span><em class="ing"></em><spring:message code='usercenter.initindex.msg8' /></span>
                            </c:if>
                            <c:if test="${r.progress>105111}">
                                <span><em class="end"></em><spring:message code='usercenter.initindex.msg9' /></span>
                            </c:if>
                            <c:if test="${r.isbid==101001}">
                                <span><em class="zb"></em><spring:message code='usercenter.initindex.msg10' /></span>
                            </c:if>
                        </div>
                        <div class="event_pcon">
                                ${r.description}
                        </div>
                        <div class="event_money"><em>￥<f:formatNumber value="${r.budget}" pattern="#00.#"/></em></div>
                        <div class="event_time">
                            <p><em class="ico_user"></em><spring:message code='usercenter.initindex.msg11' /><em> ${r.persons}</em><spring:message code='usercenter.initindex.msg12' /></p>
                            <p><em class="ico_rili"></em>
                                <c:if test="${r.days >0}">
                                    <spring:message code='usercenter.initindex.msg13' /><em>${r.days}</em><spring:message code='usercenter.initindex.msg14' />
                                </c:if>
                                <c:if test="${r.days <=0}">
                                    <spring:message code='usercenter.initindex.msg9' />
                                </c:if>
                            </p>
                        </div>
                    </div>
                    <div class="clr"></div>
                </li>
            </c:forEach>
        </ul>
    </div>
</div>
<div class="member_box">
    <div class="member_title"><spring:message code='usercenter.initindex.msg15' /><em><a href="${path}/taskList/taskList.html"><spring:message code='usercenter.initindex.msg2' /></a></em><em><a href="${path}/taskList/taskList.html"><spring:message code='usercenter.initindex.msg3' /></a></em><span><a href="${path}/taskList/taskList.html"><spring:message code='usercenter.initindex.msg4' /></a></span></div>
    <div class="member_eventlist">
        <ul>
            <c:forEach var="s" items="${stasks}">
                <li class="clearfix">
                    <div class="event_img"><img src="${path}/${s.pic}" width="170" height="104" onerror="javascript:this.src='${path}/style/common/images/headimg.jpg'"  onclick="window.location='${path}/taskdetail/index.html?taskId=${s.itemId}'" style="cursor: pointer"></div>
                    <div class="event_con clearfix">
                        <a href="${path}/taskdetail/index.html?taskId=${s.itemId}"><h3>${s.title}</h3></a>
                        <div class="shuxing">
                            <c:if test="${s.lang!='zh_cn'}">
                                <span><em class="gj"></em><spring:message code='usercenter.initindex.msg5' /></span>
                            </c:if>
                            <c:if test="${s.lang=='zh_cn'}">
                                <span><em class="gj"></em><spring:message code='usercenter.initindex.msg6' /></span>
                            </c:if>
                            <c:if test="${s.progress==105105}">
                                <span><em class="zb"></em><spring:message code='usercenter.initindex.msg7' /></span>
                            </c:if>
                            <c:if test="${s.progress>105105 && r.progress<=105110}">
                                <span><em class="ing"></em><spring:message code='usercenter.initindex.msg8' /></span>
                            </c:if>
                            <c:if test="${s.progress>105111}">
                                <span><em class="end"></em><spring:message code='usercenter.initindex.msg9' /></span>
                            </c:if>
                        </div>
                        <div class="event_pcon">
                                ${s.description}
                        </div>
                        <div class="event_money"><em>￥<f:formatNumber value="${s.budget}" pattern="#00.#"/></em></div>
                        <div class="event_time">
                            <p><em class="ico_user"></em><spring:message code='usercenter.initindex.msg11' /><em>${s.persons}</em><spring:message code='usercenter.initindex.msg12' /></p>
                            <p><em class="ico_rili"></em>
                                <c:if test="${s.days >0}">
                                    <spring:message code='usercenter.initindex.msg13' /><em>${s.days}</em><spring:message code='usercenter.initindex.msg16' />
                                </c:if>
                                <c:if test="${s.days <=0}">
                                    <spring:message code='usercenter.initindex.msg9' />
                                </c:if>
                            </p>
                        </div>
                    </div>
                    <div class="clr"></div>
                </li>
            </c:forEach>
        </ul>
    </div>
</div>
<div class="member_wrap">
    <div class="member_indexjqll">
        <div class="member_title"><spring:message code='usercenter.initindex.msg17' /></div>
        <div class="member_jqll">
            <ul id="history_tasks">

            </ul>
        </div>
    </div>
    <div class="member_indexnews">
        <div class="member_title"><spring:message code='usercenter.initindex.msg18' /><span><a href="${path}/new/index.html"><spring:message code='usercenter.initindex.msg19' /></a></span></div>
        <div class="member_newslist">
            <ul>
                <c:forEach var="n" items="${news}" varStatus="k">
                    <c:if test="${k.index%2==0}">
                        <li><span><f:formatDate value="${n.createTime}" type="date"/></span><em>●</em><a href="${path}/new/view.html?id=${n.articleId}">
                            <c:if test="${fn:length(n.title)>18}">
                                ${fn:substring(n.title,0,18)}...
                            </c:if>
                            <c:if test="${fn:length(n.title)<=18}">
                                ${n.title}
                            </c:if>
                        </a></li>
                    </c:if>
                    <c:if test="${k.index%2!=0}">
                        <li class="db"><span><f:formatDate value="${n.createTime}" type="date"/></span><em>●</em><a href="${path}/new/view.html?id=${n.articleId}">
                            <c:if test="${fn:length(n.title)>18}">
                                ${fn:substring(n.title,0,18)}...
                            </c:if>
                            <c:if test="${fn:length(n.title)<=18}">
                                ${n.title}
                            </c:if>
                        </a></li>
                    </c:if>
                </c:forEach>
            </ul>
        </div>
    </div>
    <div class="clr"></div>
</div>
<script src="${path}/js/jquery.cookie.js" type="text/javascript"></script>
<script>
    //获取最近查看历史记录
    function historyTask(){
        var history_task = $.cookie("history_task");
        var htmlstr='';
        if(history_task != null) {
            var arr = history_task.split(",");
            //console.log(arr);
            for(var i=0;i<arr.length;i++) {
                var arr2 = arr[i].split(";");
                var price = arr2[3].substring(0,arr2[3].indexOf(".")+3);
                htmlstr += '<li class="clearfix">'+
                        '<div class="jqll_img"><img src="${path}/'+arr2[1]+'" width="170" height="104"  onclick="window.location=\'${path}/taskdetail/index.html?taskId='+arr2[0]+'\'" style="cursor: pointer"></div>'+
                        '<div class="jqll_rcon clearfix">'+
                        '<h3>'+arr2[2]+'</h3>'+
                        '<div class="shuxing">'+
                        '<span><em class="zb"></em>'+arr2[4]+'</span>'+
                        '</div>'+
                        '<p>'+
                        '<spring:message code='usercenter.initindex.msg20' />'+ price +
                        '</p>'+
                        '</div>'+
                        '<div class="clr"></div>'+
                        '</li>';
            }
            $("#history_tasks").html(htmlstr);
        }
        $("#kkpager").hide();
    }
    $(function(){
        historyTask();
    });
</script>
<jsp:include page="../usercenter/leftMenuEnd.jsp"></jsp:include>
<jsp:include page="../public/footer.jsp"></jsp:include>
</body>
</html>
